<template>

  <div style="height:500px">
    <Button @click="getCheckedRows">得到选中</Button>
    <Button @click="addItems">添加</Button>
    <Button @click="removeItems">删除</Button>
    <yfu-listcheckboxpanel :listCheckBoxPanelParam="listCheckBoxPanelParam" ref="yfuListCheckBoxPanelDemo">
    </yfu-listcheckboxpanel>
  </div>

</template>
<script type="text/javascript">
  import yfuListCheckBoxPanel from '@/components/common/yfuListCheckBoxPanel.vue'
  export default {
    components: {
      'yfu-listcheckboxpanel': yfuListCheckBoxPanel
    },
    methods: {
      // 得到选中
      getCheckedRows () {
        alert(this.$refs.yfuListCheckBoxPanelDemo.getCheckeds())
      },
      // 添加
      addItems () {
        let demo = {
          'id': 9,
          'moduleName': 'fasdf'
        }
        this.$refs.yfuListCheckBoxPanelDemo.addItems(demo)
      },
      // 删除
      removeItems () {
        this.$refs.yfuListCheckBoxPanelDemo.removeItems()
      }
    },
    data () {
      return {
        listCheckBoxPanelParam: {
          title: '标题',
          width: '20%',
          height: '200px',
          baseURL: process.env.BASE_API,
          url: '/static/moduleList.json',
          urlParam: {
            organizationId: 1
          },
          defaultSelected: 1,
          name: 'moduleName',
          showSearch: true
        }
      }
    }
  }
</script>
<style>
</style>
